package com.estagio.entity;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table (name="contaPagar")
public class ContaPagar extends Conta {

	@Id
	@SequenceGenerator(name="contaPagar_id", sequenceName="contaPagar_id_seq",allocationSize=1,initialValue = 1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="contaPagar_id" )
	private Integer idContaPagar;
	
	@JoinColumn(name="idCompra")
	@ManyToOne
	private Compra compra;	
	
	@JoinColumn(name="idFornecedor")
	@ManyToOne	
	private Fornecedor fornecedor;
	public Fornecedor getFornecedor() {
		return fornecedor;
	}
	public void setFornecedor(Fornecedor fornecedor) {
		this.fornecedor = fornecedor;
	}
	public Integer getIdContaPagar() {
		return idContaPagar;
	}
	public void setIdContaPagar(Integer idContaPagar) {
		this.idContaPagar = idContaPagar;
	}
	public Compra getCompra() {
		return compra;
	}
	public void setCompra(Compra compra) {
		this.compra = compra;
	}
	
}
